<%@ include file="../inc/init.jsp" %>

<html>
	<head>
		<title>
			Graduate Admission System | University of California - San Diego | 
			Admin Overview 
		</title>
		<link type="text/css" rel="stylesheet" href="<%= BASE %>css/main.css">
	</head>
	<body>
		<div class="header-top"></div>
		<div class="header">
			<a href="<%= BASE %>admin/index.jsp"><img src="<%= BASE %>img/logo.png"></a>
		</div>
		<div class="content">
		
		<table>
		<tr><td>You are logged in as: <b><%= request.getRemoteUser() %></b>&nbsp;&nbsp;</td>
			<td><a href="<%= BASE %>logout.jsp?page=admin">
				<img src="<%= BASE %>img/logout.png"></a>
			</td>
		</tr>
		</table><br>
		
		<%
			/** Show admin menu **/
			
			if(request.isUserInRole("admin"))
			{
				out.print("<h2>Admin Overview</h2>");
				
				out.print("<ul><li><a href=\"populate.jsp\">Populate Database</a></li></ul>");	
			} 
			else if(request.isUserInRole("chair")) // Show chair menu
			{
				out.print("<h2>Chair Overview</h2>");
				
				out.print("<ul><li><a href=\"applications/applications.jsp\">Applications</a></li>" +
						  "<li><a href=\"applications/disciplineAnalytics.jsp\">Discipline Analytics</a></li>" +
						  "<li><a href=\"applications/specializationAnalytics.jsp\">Specialization Analytics</a></li>" +
						  "<li><a href=\"gre/index.jsp\">New GRE</a></li></ul>");
			}
			else
			{
				response.sendRedirect(BASE + "index.jsp");
			}
		
		%>
		</div>
	</body>
</html>